package mirrormonkey.core.messages;

import mirrormonkey.core.member.ConstructorData;
import mirrormonkey.framework.entity.EntityData;

import com.jme3.network.Message;
import com.jme3.network.serializing.Serializable;

@Serializable
public class EntityInitMessage implements Message {

	public int entityId;

	public String className;

	public String connectedClassName;

	public int constrId;

	public Object[] packedParams;

	public EntityInitMessage() {
	}

	public EntityInitMessage(EntityData data, ConstructorData constr,
			Object... constrParams) {
		entityId = data.getId();
		className = constr.getConnectedClassName();
		connectedClassName = constr.getLocalClassName();
		constrId = constr.getId();
		packedParams = constr.packParams(constrParams);
	}

	@Override
	public boolean isReliable() {
		return true;
	}

	@Override
	public Message setReliable(boolean reliable) {
		return this;
	}

}
